// 引用方式.
// import db from "utils/localstorage/main.js";

import LocalStorageIgnoreList from "./classes/LocalStorageIgnoreList.js";

const db_old = {
  save(key, value) {
    localStorage.setItem(key, JSON.stringify(value));
  },

  /** 这个预设值是必要的 有一些业务需要借助这样的默认返回值 */
  get(key, defaultValue = {}) {
    return JSON.parse(localStorage.getItem(key)) || defaultValue;
  },

  remove(key) {
    localStorage.removeItem(key);
  },

  clear() {
    localStorage.clear();
  },
};

const db = new LocalStorageIgnoreList();
export default db;
